<template>
  <view v-if="visible" class="modal-overlay" @click="$emit('close')">
    <view class="modal-container" @click.stop>
      <view class="modal-header">
        <text class="modal-title">好友选项</text>
        <button class="close-btn" @click="$emit('close')">✕</button>
      </view>
      <view class="modal-content">
        <view class="option-item" @click="$emit('start-chat')">
          <text class="option-icon">💬</text>
          <text class="option-text">开始聊天</text>
        </view>
        <view class="option-item" @click="$emit('view-profile')">
          <text class="option-icon">👤</text>
          <text class="option-text">查看资料</text>
        </view>
        <view class="option-item danger" @click="$emit('remove-friend')">
          <text class="option-icon">🗑️</text>
          <text class="option-text">删除好友</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'FriendOptionsModal',
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  }
}
</script>

<style scoped>
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-container {
  width: 80%;
  max-width: 600rpx;
  background: white;
  border-radius: 16rpx;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24rpx;
  border-bottom: 1rpx solid #f0f0f0;
}

.modal-title {
  font-size: 28rpx;
  font-weight: bold;
  color: #333;
}

.close-btn {
  width: 48rpx;
  height: 48rpx;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  font-size: 24rpx;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.modal-content {
  padding: 16rpx 0;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 16rpx;
  padding: 24rpx 32rpx;
  transition: background 0.3s ease;
}

.option-item:active {
  background: #f8f9fa;
}

.option-item.danger {
  color: #ff4d4f;
}

.option-icon {
  font-size: 32rpx;
}

.option-text {
  font-size: 26rpx;
  color: #333;
}

.option-item.danger .option-text {
  color: #ff4d4f;
}
</style>

